]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
unlockDialog: ignore resets after success
authorRay Strode <rstrode@redhat.com>
Mon, 18 Mar 2013 05:14:44 +0000 (01:14 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 18 Mar 2013 23:01:30 +0000 (19:01 -0400)
GDM sends a reset signal after verification succeeds
so that a user-switched login screen can prepare for
the next time it's going to be used.

The unlock screen treats resets as failures, though.
This means, on success, we're emitting "failed" and
clearing any last second messages.

This commit changes the unlock code to ignore resets from
GDM after successful verification.

https://bugzilla.gnome.org/show_bug.cgi?id=694688

js/ui/unlockDialog.js

index 70452a8de1c03c002c2144dc22a20cc05fcd59b4..f9227a34c7934f22e233020e7d3adbb105a164b3 100644 (file)
@@ -47,6 +47,7 @@ const UnlockDialog = new Lang.Class({
 
         this._greeterClient = new Gdm.Client();
         this._userVerifier = new GdmUtil.ShellUserVerifier(this._greeterClient, { reauthenticationOnly: true });
+        this._userVerified = false;
 
         this._userVerifier.connect('ask-question', Lang.bind(this, this._onAskQuestion));
         this._userVerifier.connect('show-message', Lang.bind(this, this._showMessage));
@@ -250,18 +251,22 @@ const UnlockDialog = new Lang.Class({
     },
 
     _onVerificationComplete: function() {
+        this._userVerified = true;
         this._userVerifier.clear();
         this.emit('unlocked');
     },
 
     _onReset: function() {
-        this._userVerifier.clear();
-        this.emit('failed');
+        if (!this._userVerified) {
+            this._userVerifier.clear();
+            this.emit('failed');
+        }
     },
 
     _onVerificationFailed: function() {
         this._currentQuery = null;
         this._firstQuestion = true;
+        this._userVerified = false;
 
         this._promptEntry.text = '';
         this._promptEntry.clutter_text.set_password_char('\u25cf');